package com.xyx.hw;

import java.util.Scanner;

public class HomeWork0720 {
//空心菱形
	public void test01(int s){
		
		   int line=s;
			 for(int m = 1; m <=(line+1)/2; m++)
		     {
				 if(m==1) {
						for(int o=1;o<=(line+1)/2;o++) {
							System.out.print(" ");
						}
						System.out.println("*");
					}
		         for(int b = 1; b <=(line+1)/2-m ; b++)
		         {
		             System.out.print(" ");
		         }
		         for(int n=1;n<=2;n++) {
		        	 
						System.out.print("*");
						if(n<2) {
						for(int t=1;t<=m*2-1;t++) {
							System.out.print(" ");
							}
						   }
						}
		         System.out.println();
					}
		     for(int d =(line+1)/2-1;d >= 1; d --)
		     {
		    	 //输出外部空格
		         for(int b = 1; b <= (line+1)/2-d; b++)
		         {
		             System.out.print(" ");
		         }
		         //输出边框 *  *
		         for(int n=1;n<=2;n++) {
		        	
		        	 System.out.print("*");
		        	 if(n<2) {
		         for(int c = (line+1)/2-d; c <=(line+1)/2-2+d; c ++){
		 			System.out.print(" ");
		     	} 
		        	 }
		    } 
		         System.out.println();
		    if(d==1) {
				for(int o=1;o<=(line+1)/2;o++) {
					System.out.print(" ");
				}
				System.out.println("*");
			}
		   }
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		HomeWork0720 zm1=new HomeWork0720();
		Scanner sc=new Scanner(System.in);
		
		//九九乘法表
		System.out.println("九九乘法表");
		for(int i=1;i<=9;i++) {
			for (int k=1;k<=i;k++) {
				System.out.print(k+"*"+i+"="+(i*k)+"  ");
			}
			System.out.println();
		}
		//等腰三角形
	
		int line=sc.nextInt();
		System.out.println("空心菱形");
		zm1.test01(line);
		System.out.println("等腰三角形");
		for(int x=1;x<line;x++) {
			for(int m=x;m<line;m++) {
				System.out.print(" ");
			}
				for(int n=1;n<=x*2-1;n++) {
					System.out.print("*");
				}
				System.out.println();
			}
		
		//空心等腰三角形
		System.out.println("空心等腰三角形");
		int num=0;
		for(int x=1;x<line;x++) {
			num++;
			if(x==1) {
				for(int o=1;o<=line;o++) {
					System.out.print(" ");
				}
				System.out.println("*");
			}
			for(int m=x;m<line;m++) {
				System.out.print(" ");
			}
				for(int n=1;n<=2;n++) {
					System.out.print("*");
					if(n<2)
					for(int t=1;t<=x*2-1;t++) {
						if(num==line-1) {
							System.out.print("*");
						}else{
						System.out.print(" ");
						}
					}else {
					 continue;
					}
				}
				System.out.println();
			}
		
		//菱形
		System.out.println("菱形");
		 for(int m = 1; m <=(line+1)/2; m++)
	        {
	            for(int b = 1; b <=(line+1)/2-m ; b++)
	            {
	                System.out.print(" ");
	            }
	            for(int c = 1; c <= m*2-1; c++)
	            {
	                System.out.print("*");    
	            }
	            System.out.println();
	           
	        }
	        for(int d =(line+1)/2-1;d >= 1; d --)
	        {
	            for(int b = 1; b <= (line+1)/2-d; b++)
	            {
	                System.out.print(" ");
	            }
	            for(int c = (line+1)/2-d; c <=(line+1)/2-2+d; c ++)
	            {
	                System.out.print("*");    
	            }
	            System.out.println();
	        	}
	       }

	//空心菱形



}

	



